//
//  PaperViewControllerBuild.m
//  ZYOnlineSchool
//
//  Created by 毕武侠 on 2017/3/10.
//  Copyright © 2017年 bwx. All rights reserved.
//

#import "PaperViewControllerBuild.h"

@implementation PaperViewControllerBuild

// ques_type 试题类型 0：智能刷题 1：高频错题 2：考点专练 3：历年真题 6:每日一练 7:错题练习

//小艾  1:智能刷题，02：专点专练，03：高频错题，04：历年真题，05：模拟考试，06：周测月考,

#pragma mark - answer
// 创建智能刷题答题页面
+ (PaperViewController *)createIntelligentViewController {
    PaperViewController *viewController = [self createBaseAnswerViewController];
//    viewController.title = @"智能刷题";
    viewController.ques_type = @(0);
    viewController.backViewController = @"ExamViewController";
//    viewController.url = ChapterQuestionList;

    viewController.params = @{};
//答题
    viewController.paperIdentifier = @"PaperAnswerID";//答题
    viewController.rmodel = @"PaperAnswerModel";
    
//    viewController.answerType = @"chapter_id";
    
    
    viewController.showToolTimer = NO;
    viewController.showPaperAnaly = NO;
    viewController.showAnswerAnaly = NO;
    viewController.showKnowledge = NO;

    
    viewController.receiveIndex = 0;
    return viewController;
}


#pragma mark - analy all
// 创建 智能刷题 所有解析页面
+ (PaperViewController *)createIntelligentAllAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createAllAnalyViewController];
    viewController.ques_type = @(0);
//    viewController.url = ChapterQuestionList;
    viewController.params = @{};
    //解析
    viewController.rmodel = @"PaperAnalyModel";
    viewController.paperIdentifier = @"PaperAnalyID";//解析
    
//    viewController.answerType = @"chapter_id";

    viewController.showToolTimer = NO;
    viewController.showPaperAnaly = YES;
    viewController.showAnswerAnaly = YES;
    viewController.showKnowledge = NO;

    return viewController;
}



#pragma mark - ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️

//创建课后练习答题页面
+ (PaperViewController *)createHomeworkViewControllerWithData:(NSDictionary *)data{
    PaperViewController *viewController = [self createBaseAnswerViewController];
    viewController.title = @"课后练习";
    viewController.ques_type = @(8);
    viewController.backViewController = @"ExamViewController";
    viewController.url = @"Question/course_question";
    viewController.rmodel = @"PaperAnswerModel";
    viewController.params = @{@"chapter_id":data[@"chapter_id"] ? : @""};
    
    viewController.paperIdentifier = @"PaperAnswerID";
    
    viewController.receiveIndex = 0;
    return viewController;
}

// 创建考点专练答题页面
+ (PaperViewController *)createExerciseViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createBaseAnswerViewController];
    viewController.title = data[@"title"];
    viewController.ques_type = @(2);
    viewController.backViewController = @"ExerciseViewController";
    viewController.url = @"Question/kdzl";
    viewController.rmodel = @"PaperAnswerModel";
    viewController.params = @{@"knows_id": data[@"knows_id"]};
    
    viewController.paperIdentifier = @"PaperAnswerID";
    viewController.receiveIndex = 0;
    
    return viewController;
}

// 创建高频错题答题页面
+ (PaperViewController *)createHighFrequencyWrongViewController {
    PaperViewController *viewController = [self createBaseAnswerViewController];
    viewController.title = @"高频错题";
    viewController.ques_type = @(1);
    viewController.backViewController = @"ExamViewController";
    viewController.url = @"Question/gpct";
    viewController.rmodel = @"PaperAnswerModel";
    viewController.params = @{};
    
    viewController.paperIdentifier = @"PaperAnswerID";
    viewController.receiveIndex = 0;
    
    return viewController;
}

// 创建历年真题答题页面
+ (PaperViewController *)createPastYearViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createBaseAnswerViewController];
    viewController.title = @"历年真题";
    viewController.ques_type = @(3);
    viewController.backViewController = @"PastYearViewController";
    viewController.url = @"Question/lnzt_begin";
    viewController.rmodel = @"PaperModuleModel";
    viewController.params = data;
    
    viewController.paperIdentifier = @"PaperAnswerID";
    viewController.receiveIndex = 1;
    viewController.showToolModuleTitleView = YES;
    
    return viewController;
}

// 创建模拟考试答题页面
+ (PaperViewController *)createSimulateExamViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createBaseAnswerViewController];
    viewController.title = @"模拟考试";
    viewController.ques_type = @(3);
    viewController.backViewController = @"SimulateSignalExamViewController";
    viewController.url = @"Question/mk_begin";
    viewController.rmodel = @"PaperModuleModel";
    viewController.params = data;
    
    viewController.paperIdentifier = @"PaperAnswerID";
    viewController.receiveIndex = 1;
    viewController.showToolModuleTitleView = YES;
    
    return viewController;
}

// 创建错题练习答题页面
+ (PaperViewController *)createWrongRecordViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createBaseAnswerViewController];
    viewController.title = @"错题练习";
    viewController.ques_type = @(7);
    viewController.backViewController = @"WrongRecordViewController";
    viewController.url = @"Question/knowsQues_count";
    viewController.rmodel = @"PaperAnswerModel";
    viewController.params = data;
    
    viewController.paperIdentifier = @"PaperAnswerID";
    viewController.receiveIndex = 0;
    
    return viewController;
}

// 创建每日一练答题页面
+ (PaperViewController *)createPracticeDailyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createBaseAnswerViewController];
    viewController.title = @"每日一练";
    viewController.ques_type = @(6);
    viewController.backViewController = @"PracticeDailyViewController";
    viewController.url = @"Question/mryl";
    viewController.rmodel = @"PaperAnswerModel";
    viewController.params = data;
    
    viewController.paperIdentifier = @"PaperAnswerID";
    viewController.receiveIndex = 0;
    
    return viewController;
}

// 创建通用的答题页面
+ (PaperViewController *)createBaseAnswerViewController {
    PaperViewController *viewController = [[PaperViewController alloc] init];
    viewController.showPaperAnaly = NO;
    viewController.showAnswerAnaly = NO;
    viewController.showKnowledge = NO;
    viewController.showComment = NO;
    viewController.showToolCardTitleView = NO;
    return viewController;
}




// 创建 高频错题 所有解析页面
+ (PaperViewController *)createHighFrequencyAllAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createAllAnalyViewController];
    viewController.ques_type = @(1);
    viewController.url = @"Question/gpct_analysis_all";
    viewController.params = data;
    return viewController;
}

// 创建 考点专练 所有解析页面
+ (PaperViewController *)createExerciseAllAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createAllAnalyViewController];
    viewController.ques_type = @(2);
    viewController.url = @"Question/kdzl_analysis_all";
    viewController.params = data;
    return viewController;
}

// 创建 错误练习 所有解析页面
+ (PaperViewController *)createWrongRecordAllAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createAllAnalyViewController];
    viewController.ques_type = @(7);
    viewController.url = @"Question/ct_analysis_all";
    viewController.params = data;
    return viewController;
}

// 创建 每日一练 所有解析页面
+ (PaperViewController *)createPracticeDailyAllAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createAllAnalyViewController];
    viewController.ques_type = @(6);
    viewController.url = @"Question/mryl_analysis";
    viewController.params = data;
    return viewController;
}

// 创建 历年真题 所有解析页面
+ (PaperViewController *)createPastYearAllAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createAllAnalyViewController];
    viewController.ques_type = @(3);
    viewController.rmodel = @"PaperModuleModel";
    viewController.url = @"Question/tj_analysisforajax";
    viewController.params = data;
    viewController.receiveIndex = 1;
    viewController.showToolModuleTitleView = YES;
    
    return viewController;
}

// 创建 收藏 解析页面
+ (PaperViewController *)createFavoriteRecordAllAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createAllAnalyViewController];
    viewController.ques_type = @(10);
    viewController.url = @"Question/FavoritesQues_count";
    viewController.params = data;
    viewController.showPaperAnaly = NO;
    return viewController;
}

// 创建通用全部解析页面
+ (PaperViewController *)createAllAnalyViewController {
    PaperViewController *viewController = [self createBaseAnalyViewController];
    viewController.title = @"全部解析";
    viewController.rmodel = @"PaperAnalyModel";
    viewController.paperIdentifier = @"PaperAnalyID";
    viewController.receiveIndex = 0;
    viewController.showToolCardTitleView = NO;
    return viewController;
}


#pragma mark - analy wrong
// 创建 智能刷题 错误解析页面 ❌
+ (PaperViewController *)createIntelligentWrongAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createWrongAnalyViewController];
    viewController.ques_type = @(0);
    viewController.url = @"Question/znst_analysis_wrong";
    viewController.params = data;
    return viewController;
}

// 创建 高频错题 错误解析页面 ❌
+ (PaperViewController *)createHighFrequencyWrongAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createWrongAnalyViewController];
    viewController.ques_type = @(1);
    viewController.url = @"Question/gpct_analysis_wrong";
    viewController.params = data;
    return viewController;
}

// 创建 考点专练 错误解析页面 ❌
+ (PaperViewController *)createExerciseWrongAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createWrongAnalyViewController];
    viewController.ques_type = @(2);
    viewController.url = @"Question/kdzl_analysis_wrong";
    viewController.params = data;
    return viewController;
}

// 创建 错误练习 错误解析页面 ❌
+ (PaperViewController *)createWrongRecordWrongAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createWrongAnalyViewController];
    viewController.ques_type = @(7);
    viewController.url = @"Question/ct_analysis_wrong";
    viewController.params = data;
    return viewController;
}

// 创建 每日一练 错误解析页面 ❌
+ (PaperViewController *)createPracticeDailyWrongAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createWrongAnalyViewController];
    viewController.ques_type = @(6);
    viewController.url = @"Question/mryl_analysis_wrong";
    viewController.params = data;
    return viewController;
}

// 创建 历年真题 错误解析页面 ❌
+ (PaperViewController *)createPastYearWrongAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createWrongAnalyViewController];
    viewController.ques_type = @(3);
    viewController.rmodel = @"PaperModuleModel";
    viewController.url = @"Question/tj_analys_wrong";
    viewController.params = data;
    viewController.receiveIndex = 1;
    viewController.showToolModuleTitleView = YES;
    
    return viewController;
}

// 创建通用错误解析页面
+ (PaperViewController *)createWrongAnalyViewController {
    PaperViewController *viewController = [self createBaseAnalyViewController];
    viewController.title = @"错题解析";
    viewController.rmodel = @"PaperAnalyModel";
    viewController.paperIdentifier = @"PaperAnalyID";
    viewController.receiveIndex = 0;
    viewController.showToolCardTitleView = NO;
    return viewController;
}

#pragma mark - analy signal

// 创建 智能刷题 单个解析页面
+ (PaperViewController *)createIntelligentSignalAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createSignalAnalyViewController];
    viewController.ques_type = @(0);
    viewController.url = @"Question/znst_ques_analysis";
    viewController.params = data;
    return viewController;
}

// 创建 高频错题 单个解析页面
+ (PaperViewController *)createHighFrequencySignalAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createSignalAnalyViewController];
    viewController.ques_type = @(1);
    viewController.url = @"Question/gpct_ques_analysis";
    viewController.params = data;
    return viewController;
}

// 创建 考点专练 单个解析页面
+ (PaperViewController *)createExerciseSignalAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createSignalAnalyViewController];
    viewController.ques_type = @(2);
    viewController.url = @"Question/kdzl_ques_analysis";
    viewController.params = data;
    return viewController;
}

// 创建 错误练习 单个解析页面
+ (PaperViewController *)createWrongRecordSignalAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createSignalAnalyViewController];
    viewController.ques_type = @(7);
    viewController.url = @"Question/ct_ques_analysis";
    viewController.params = data;
    return viewController;
}

// 创建 每日一练 单个解析页面
+ (PaperViewController *)createPracticeDailySignalAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createSignalAnalyViewController];
    viewController.ques_type = @(6);
    viewController.url = @"Question/mryl_ques_analysis";
    viewController.params = data;
    return viewController;
}

// 创建 历年真题 单个解析页面
+ (PaperViewController *)createPastYearSignalAnalyViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createSignalAnalyViewController];
    viewController.ques_type = @(3);
    viewController.url = @"Question/tj_analys_ques";
    viewController.params = data;
    return viewController;
}

// 创建通用单个解析页面
+ (PaperViewController *)createSignalAnalyViewController {
    PaperViewController *viewController = [self createBaseAnalyViewController];
    viewController.title = @"解析";
    viewController.rmodel = @"PaperAnalyModel";
    viewController.paperIdentifier = @"PaperAnalyID";
    viewController.receiveIndex = 0;
    viewController.showToolCard = NO;
    return viewController;
}

#pragma mark - self test
// 创建申论自测答题页面
+ (PaperViewController *)createSelfTestViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createBaseAnalyViewController];
    viewController.title = @"申论自测";
    viewController.ques_type = @(4);
    viewController.url = @"Question/test_begin";
    viewController.params = data;
    
    viewController.rmodel = @"PaperTestModel";
    viewController.paperIdentifier = @"PaperTestID";
    viewController.receiveIndex = 0;
    
    return viewController;
}

// 创建通用的解析页面
+ (PaperViewController *)createBaseAnalyViewController {
    PaperViewController *viewController = [[PaperViewController alloc] init];
    viewController.showToolTimer = NO;
    viewController.showToolPen = NO;
    viewController.showToolTitle = YES;
    viewController.isAllowAnswer = NO;
    return viewController;
}

#pragma mark - data

// 创建 搜索 单个页面
+ (PaperViewController *)createSearchSignalViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createSignalAnalyViewController];
    viewController.title = @"搜索";
    viewController.ques_type = @(5);
    viewController.url = @"Question/search_ques";
    viewController.params = data;
    viewController.showPaperAnaly = NO;

    return viewController;
}
// 创建收藏
+ (PaperViewController *)createFavoriteSignalViewControllerWithData:(NSDictionary *)data {
    PaperViewController *viewController = [self createSignalAnalyViewController];
    viewController.title = @"搜索";
//    viewController.ques_type = @(5);
    viewController.url = @"Apifavorite/favorite_question";
    viewController.params = data;
    viewController.showPaperAnaly = NO;
    
    return viewController;
}

+ (PaperDataViewController *)createBaseDataViewControllerWithData:(NSDictionary *)data {
    PaperDataViewController *viewController = [[PaperDataViewController alloc] init];
    viewController.showToolTimer = NO;
    viewController.showToolPen = NO;
    viewController.showToolTitle = YES;
    viewController.isAllowAnswer = NO;
    return viewController;
}

@end
